package net.spleefultimate;

import net.spleefultimate.registerapi.payment.Method;
import net.spleefultimate.registerapi.payment.Methods;
import net.spleefultimate.registerapi.payment.Method.MethodAccount;

import org.bukkit.entity.Player;

public class RegisterManager
{
  public static boolean hasMethod()
  {
    return Methods.hasMethod();
  }

  public static Method getMethod()
  {
    return Methods.hasMethod() ? Methods.getMethod() : null;
  }

  public static boolean hasAccount(Player player)
  {
    if (hasMethod()) {
      return getMethod().hasAccount(player.getName());
    }
    return false;
  }

  public static Method.MethodAccount getAccount(Player player)
  {
    if ((hasMethod()) && 
      (hasAccount(player))) {
      return getMethod().getAccount(player.getName());
    }
    return null;
  }
}